<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<script language=javascript>

<%
String msg = (String)session.getAttribute("MSG");
session.removeAttribute("MSG");
if(msg != null){
%>
    alert("<%=msg%>");
<%
}
%>

var list_code = "listReportProduct";


function process(val)
{
    SetValue("title","18");
    SetValue("providerName",GetValue("i_ProviderName"));
    SetValue("warehouseCode",GetValue("i_WarehouseCode"));
    SetValue("needAll",GetValue("i_needAll"));
    SetValue("balanceMode",GetValue("i_BalanceMode"));
    //仓库判断
    if(GetValue("i_WarehouseCode") == "000000"){
        alert("请指定一个非总库的仓库");
        return false;
    }
    
    //供应商判断
    //if(GetValue("i_needAll") != "yes" && GetValue("i_ProviderName") == ""){
    //    alert("请选择供应商");
    //    return false;
    //}
    if(val == '1'){
        SetValue("begindate",GetValue("i_Year"));
        SetValue("enddate",GetValue("i_Month"));
        SetValue("querytype","1");
    }else{
        if(GetValue("i_StartLastUpdate") == ""){
            alert("起始日期不可为空!");
            return false;
        }
        SetValue("begindate",GetValue("i_StartLastUpdate"));
        SetValue("enddate",GetValue("i_EndLastUpdate"));
        SetValue("querytype","2");
    }/***
    if(GetValue("i_ProviderName") == ""){
        alert("请输入供应商名称!");
        return false;
    }***/
    frm.action = "<%=response.encodeURL(Config.getWebPath() + "/servlet/ReportServletHis") %>";
    frm.submit();
}
//供应商选择后处理
function onSelectProvider(obj)
{
    SetValue("providerName", obj.Name);
    document.all.i_ProviderName.value = obj.Name;
}
</script>


<%=uiBody%>>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="providerName" value="">
<input type=hidden name="warehouseCode" value="">
<input type='hidden' name='begindate' value="">
<input type='hidden' name='enddate' value="">
<input type='hidden' name='querytype' value="">
<input type='hidden' name='title' value="">
<input type='hidden' name='needAll' value="">
<input type='hidden' name='balanceMode' value="">

<!--查询条件保留区域-->


<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
    int key_tab = 1 ;
%>

<table id=listTable cellpadding='1' cellspacing='1' width='100%' class='data_line'><thead class='data_th'>

<tr align='center' height='24'>

    <td colspan = "2">压库产品进、销、存报表</td></tr>

    
<tbody class='data_tb'>
    <tr height="24"  bgcolor="#EBEEF3">
        <td colspan = "2">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仓库选择：
        <%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"i_WarehouseCode","",false,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
        &nbsp;&nbsp;结算模式：        <select name="i_BalanceMode" style="width: 100px">
        							<option value='0' selected="selected">全部</option>
        							<option value='1'>压库</option>
        							<option value='2'>买断</option>
        						</select>
        &nbsp;&nbsp;供应商：<input type="text" class="texts" name="i_ProviderName" size="20" value="" key_tab="<%=key_tab++%>">
        <input type=button class=buttons value="选择" onclick="bizSelectProvider(false);return false">
        
        所有相关记录:
        <input type="checkbox" value="yes" name="i_needAll" checked="checked" />
        </td>

    </tr>

    <tr height="24"  bgcolor="#FFFFFF">

        <td >&nbsp;选择结算月份：<%=SelectManager.viewYearSelectHis(con,"i_Year","2008",false,"","-请选择-","","")%>  <%=SelectManager.viewMonthSelect(con,"i_Month","01",false,"","-请选择-","","")%></td>

        <td >
            <input type="button" name="button1" class='buttons' value="生成报表" onclick='process(1)'>
        </td>
    </tr>

    <tr height="24"  bgcolor="#EBEEF3">

    
        <td >&nbsp;&nbsp;&nbsp;选择时间段：<%=framework.custom.UIManager.generateDateInputHis("i_StartLastUpdate", "")%> 至 <%=framework.custom.UIManager.generateDateInputHis("i_EndLastUpdate", "")%></td>
    

        <td >
            <input type="button" name="button2" class='buttons' value="生成报表" onclick='process(2)'>
        </td>
    </tr>
</tbody>

</table>


<%=uiSearchEnd%>

</form>


<%@ include file="/framework/foot.jsp"%>
